<%@page import="com.wanmait.movies.vo.User"%>
 
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<style type="text/css">
	/*
		head包含jsp实现功能
			1.所有的jsp都包含head.jsp
			2.返回主页
			3.未登录时显示注册登录选项
			4.已登录状态显示用户名用户头像和退出按钮
			
	*/
	#head{
        position: absolute; 
        width:100%;
        height: 40px;
        background-color: gray;
        color: white;
        top:0px;  
    }
    #head ul{

    	float:right;
    	margin-top: 0px;
        list-style: none;
   }

    #head li{
        width: 100px;
        height: 40px;
        float: left; 
        line-height: 40px; 
         
    }
     

    #head #face{
        width: 40px;
        height:40px;
        vertical-align: middle;
        margin-top: -4px;
        border-radius: 50%;
    }

    #head a{
    	color: white;
    	text-decoration: none;
    }
    #head #gotoindex{
    	float: left;
    }
    #head #backtoindex{
    	margin-left: 50px;
    	margin-top: 0px;
    	height: 100%;
    	float: left;
    	line-height: 40px;

    }
</style>
<body>
    <div id="head">
    	<div id="backtoindex"><a id="gotoindex" href="/movies/IndexServlet?action=begin">返回首页</a></div>
    	<%
    		User ui = (User)session.getAttribute("ui");
    		if(ui!=null){
    	%>		
	    		<ul >
	                <li><a href="/movies/UserServlet?action=userPage"><%=ui.getUserName()%></a></li>
	                <li><img src="<%=request.getContextPath()%>/images/<%=ui.getUserFaceimage()%>" id="face"></li>
	                <li><a href="<%=request.getContextPath()%>/UserServlet?action=exit">退出</a></li>
	            </ul>
        <%   
    		}else{
    	%>
		    	<ul>
		            <li><a href="<%=request.getContextPath()%>/denglupage.jsp">登录</a></li>
		            <li><a href="<%=request.getContextPath()%>/registerpage.jsp">注册</a></li>
		        </ul>
    	<%		
    		}
    	%>
    </div>
</body>
